//
//  ViewController.m
//  MyFirstApp
//
//  Created by SmartStrategy on 2019/10/10.
//  Copyright © 2019 SmartStrategy. All rights reserved.
//

#import "ViewController.h"

@interface ViewController ()

@end

@implementation ViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
}

- (IBAction)clickAPP:(id)sender {
    if ([[UIApplication sharedApplication] canOpenURL: [NSURL URLWithString:@"Quantbroker:"]]) {
        //NSString *paramStr = [NSString stringWithFormat:@"Quantbroker://username=%@&age=%@&address=%@", @"test123", @"100", @"2222"];
        NSString *paramStr = [NSString stringWithFormat:@"Quantbroker:"];
        NSURL *url = [NSURL URLWithString:paramStr];
        //[[UIApplication sharedApplication] openURL:url];
        [[UIApplication sharedApplication] openURL:url options:@{} completionHandler:nil];
    }else{
        NSURL *url = [NSURL URLWithString:@"https://quantbroker.info/appDownload.html"];
        [[UIApplication sharedApplication] openURL:url options:@{} completionHandler:nil];
    }
    
}

@end
